"""
__move_one_input_applymodel_MDL.py_____________________________________________________

Automatically generated AToM3 Model File (Do not modify directly)
Author: levi
Modified: Thu Jan 31 11:18:04 2013
_______________________________________________________________________________________
"""
from stickylink import *
from widthXfillXdecoration import *
from MT_post__ApplyModel import *
from RHS import *
from LHS import *
from MT_pre__ApplyModel import *
from MT_pre__MetaModelElement_T import *
from MT_pre__apply_contains import *
from graph_MT_pre__apply_contains import *
from graph_LHS import *
from graph_MT_post__ApplyModel import *
from graph_MT_pre__ApplyModel import *
from graph_MT_pre__MetaModelElement_T import *
from graph_RHS import *
from ATOM3Enum import *
from ATOM3String import *
from ATOM3BottomType import *
from ATOM3Constraint import *
from ATOM3Attribute import *
from ATOM3Float import *
from ATOM3List import *
from ATOM3Link import *
from ATOM3Connection import *
from ATOM3Boolean import *
from ATOM3Appearance import *
from ATOM3Text import *
from ATOM3Action import *
from ATOM3Integer import *
from ATOM3Port import *
from ATOM3MSEnum import *

def move_one_input_applymodel_MDL(self, rootNode, MT_post__SimpleDSLTransMMRootNode=None, MT_pre__SimpleDSLTransMMRootNode=None, MoTifRuleRootNode=None):

    # --- Generating attributes code for ASG MT_post__SimpleDSLTransMM ---
    if( MT_post__SimpleDSLTransMMRootNode ): 
        # author
        MT_post__SimpleDSLTransMMRootNode.author.setValue('Annonymous')

        # description
        MT_post__SimpleDSLTransMMRootNode.description.setValue('\n')
        MT_post__SimpleDSLTransMMRootNode.description.setHeight(15)

        # name
        MT_post__SimpleDSLTransMMRootNode.name.setValue('')
        MT_post__SimpleDSLTransMMRootNode.name.setNone()
    # --- ASG attributes over ---


    # --- Generating attributes code for ASG MT_pre__SimpleDSLTransMM ---
    if( MT_pre__SimpleDSLTransMMRootNode ): 
        # author
        MT_pre__SimpleDSLTransMMRootNode.author.setValue('Annonymous')

        # description
        MT_pre__SimpleDSLTransMMRootNode.description.setValue('\n')
        MT_pre__SimpleDSLTransMMRootNode.description.setHeight(15)

        # name
        MT_pre__SimpleDSLTransMMRootNode.name.setValue('')
        MT_pre__SimpleDSLTransMMRootNode.name.setNone()
    # --- ASG attributes over ---


    # --- Generating attributes code for ASG MoTifRule ---
    if( MoTifRuleRootNode ): 
        # author
        MoTifRuleRootNode.author.setValue('Annonymous')

        # description
        MoTifRuleRootNode.description.setValue('\n')
        MoTifRuleRootNode.description.setHeight(15)

        # name
        MoTifRuleRootNode.name.setValue('MoveOneInputApplyModel')
    # --- ASG attributes over ---


    self.obj70=MT_post__ApplyModel(self)
    self.obj70.isGraphObjectVisual = True

    if(hasattr(self.obj70, '_setHierarchicalLink')):
      self.obj70._setHierarchicalLink(False)

    # MT_label__
    self.obj70.MT_label__.setValue('3')

    # MT_pivotOut__
    self.obj70.MT_pivotOut__.setValue('')
    self.obj70.MT_pivotOut__.setNone()

    self.obj70.graphClass_= graph_MT_post__ApplyModel
    if self.genGraphics:
       new_obj = graph_MT_post__ApplyModel(680.0,280.0,self.obj70)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_post__ApplyModel", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj70.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj70)
    self.globalAndLocalPostcondition(self.obj70, rootNode)
    self.obj70.postAction( rootNode.CREATE )

    self.obj71=RHS(self)
    self.obj71.isGraphObjectVisual = True

    if(hasattr(self.obj71, '_setHierarchicalLink')):
      self.obj71._setHierarchicalLink(False)

    # action
    self.obj71.action.setValue('#===============================================================================\n# This code is executed after the rule has been applied.\n# You can access a node labelled n matched by this rule by: PostNode(\'n\').\n# To access attribute x of node n, use: PostNode(\'n\')[\'x\'].\n#===============================================================================\n\npass\n')
    self.obj71.action.setHeight(15)

    self.obj71.graphClass_= graph_RHS
    if self.genGraphics:
       new_obj = graph_RHS(540.0,200.0,self.obj71)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("RHS", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj71.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj71)
    self.globalAndLocalPostcondition(self.obj71, rootNode)
    self.obj71.postAction( rootNode.CREATE )

    self.obj72=LHS(self)
    self.obj72.isGraphObjectVisual = True

    if(hasattr(self.obj72, '_setHierarchicalLink')):
      self.obj72._setHierarchicalLink(False)

    # constraint
    self.obj72.constraint.setValue('if len(graph.neighbors(PreNode(\'1\').index)) == 0:\n    return True\nelse:\n    return False\n')
    self.obj72.constraint.setHeight(15)

    self.obj72.graphClass_= graph_LHS
    if self.genGraphics:
       new_obj = graph_LHS(100.0,200.0,self.obj72)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("LHS", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj72.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj72)
    self.globalAndLocalPostcondition(self.obj72, rootNode)
    self.obj72.postAction( rootNode.CREATE )

    self.obj63=MT_pre__ApplyModel(self)
    self.obj63.isGraphObjectVisual = True

    if(hasattr(self.obj63, '_setHierarchicalLink')):
      self.obj63._setHierarchicalLink(False)

    # MT_label__
    self.obj63.MT_label__.setValue('3')

    # MT_pivotOut__
    self.obj63.MT_pivotOut__.setValue('')
    self.obj63.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj63.MT_subtypeMatching__.setValue(('True', 0))
    self.obj63.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj63.MT_pivotIn__.setValue('')
    self.obj63.MT_pivotIn__.setNone()

    self.obj63.graphClass_= graph_MT_pre__ApplyModel
    if self.genGraphics:
       new_obj = graph_MT_pre__ApplyModel(240.0,280.0,self.obj63)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__ApplyModel", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj63.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj63)
    self.globalAndLocalPostcondition(self.obj63, rootNode)
    self.obj63.postAction( rootNode.CREATE )

    self.obj64=MT_pre__MetaModelElement_T(self)
    self.obj64.isGraphObjectVisual = True

    if(hasattr(self.obj64, '_setHierarchicalLink')):
      self.obj64._setHierarchicalLink(False)

    # MT_pivotOut__
    self.obj64.MT_pivotOut__.setValue('element2')

    # MT_subtypeMatching__
    self.obj64.MT_subtypeMatching__.setValue(('True', 1))
    self.obj64.MT_subtypeMatching__.config = 0

    # MT_pre__classtype
    self.obj64.MT_pre__classtype.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj64.MT_pre__classtype.setHeight(15)

    # MT_pivotIn__
    self.obj64.MT_pivotIn__.setValue('element2')

    # MT_label__
    self.obj64.MT_label__.setValue('1')

    # MT_pre__name
    self.obj64.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj64.MT_pre__name.setHeight(15)

    self.obj64.graphClass_= graph_MT_pre__MetaModelElement_T
    if self.genGraphics:
       new_obj = graph_MT_pre__MetaModelElement_T(260.0,440.0,self.obj64)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__MetaModelElement_T", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj64.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj64)
    self.globalAndLocalPostcondition(self.obj64, rootNode)
    self.obj64.postAction( rootNode.CREATE )

    self.obj73=MT_pre__apply_contains(self)
    self.obj73.isGraphObjectVisual = True

    if(hasattr(self.obj73, '_setHierarchicalLink')):
      self.obj73._setHierarchicalLink(False)

    # MT_label__
    self.obj73.MT_label__.setValue('4')

    # MT_pivotOut__
    self.obj73.MT_pivotOut__.setValue('')
    self.obj73.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj73.MT_subtypeMatching__.setValue(('True', 0))
    self.obj73.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj73.MT_pivotIn__.setValue('')
    self.obj73.MT_pivotIn__.setNone()

    self.obj73.graphClass_= graph_MT_pre__apply_contains
    if self.genGraphics:
       new_obj = graph_MT_pre__apply_contains(321.5,401.0,self.obj73)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__apply_contains", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
    else: new_obj = None
    self.obj73.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj73)
    self.globalAndLocalPostcondition(self.obj73, rootNode)
    self.obj73.postAction( rootNode.CREATE )

    # Connections for obj70 (graphObject_: Obj7) of type MT_post__ApplyModel
    self.drawConnections(
 )
    # Connections for obj71 (graphObject_: Obj8) of type RHS
    self.drawConnections(
 )
    # Connections for obj72 (graphObject_: Obj9) of type LHS
    self.drawConnections(
 )
    # Connections for obj63 (graphObject_: Obj0) of type MT_pre__ApplyModel
    self.drawConnections(
(self.obj63,self.obj73,[325.0, 321.0, 321.5, 401.0],"true", 2) )
    # Connections for obj64 (graphObject_: Obj1) of type MT_pre__MetaModelElement_T
    self.drawConnections(
 )
    # Connections for obj73 (graphObject_: Obj10) of type MT_pre__apply_contains
    self.drawConnections(
(self.obj73,self.obj64,[321.5, 401.0, 318.0, 481.0],"true", 2) )

newfunction = move_one_input_applymodel_MDL

loadedMMName = ['MT_post__SimpleDSLTransMM_META', 'MT_pre__SimpleDSLTransMM_META', 'MoTifRule_META']

atom3version = '0.3'
